package at.ac.tuwien.swa075.telco.smsc.service;

import java.sql.Timestamp;

import at.ac.tuwien.swa075.telco.smsc.service.sdo.IMessageSDO;

public interface IShortMessageServiceCenter {

	/**
	 * Stores as single message that needs to be delivered to a mobile device.
	 * @param message The message to be stored
	 * @throws SmscException An error occured while storing the message.
	 */
	public abstract void storeMessage(IMessageSDO message) throws SmscException;

	/**
	 * Updates the message status.
	 * @param messageId The message id of the message that should be updated.
	 * @param status The status to set as a string 
	 * @throws SmscException
	 */
	public abstract void updateMessageStatus(String messageId, String status)
			throws SmscException;

	/**
	 * Retrive a list of undelivered messages that need to be delivered
	 * @return An array of messages that need to be delivered.
	 * @throws SmscException An error occured while searching for the messages.
	 */
	public abstract IMessageSDO[] processUndeliveredMessages()
			throws SmscException;

	/**
	 * Deletes all billed messages of a given period and returns the number of deleted messages
	 * @param from Start of the period 
	 * @param to End of the period
	 * @return The number of deleted messages.
	 * @throws SmscException An error occured while deleting the messages.
	 */
	public abstract int processBilledMessages(Timestamp from, Timestamp to)
			throws SmscException;

}